<template>
	<view>
		<view class="main_box">
			<index v-if="currentIndex === 0&&tabListNum==1" :tabListNum="tabListNum"></index>
			
			
			<dataCenter v-if="currentIndex === 1"></dataCenter>
			<myEmployees  v-if="currentIndex === 3"></myEmployees>
			<orderManagement  v-if="currentIndex === 4"></orderManagement>
		</view>
		<view class="foot_box">
			<TabBar :tabIndex="currentIndex" :showMiddleButtonBar="showMiddleButtonBar" @changeItem="changeItem"
				:tabListNum="tabListNum"></TabBar>
		</view>

	</view>
</template>

<script>
	import TabBar from '../../components/jinjie-tabbar/jinjie-tabbar.vue'
	// 套餐1
	import index from '@/pages/index/index.vue'
	import  dataCenter from '@/pages/dataCenter/dataCenter'
	import myEmployees   from '@/pages/myEmployees/myEmployees'
	import orderManagement from '@/pages/orderManagement/orderManagement'
	export default {
		components: {

			index,
			dataCenter,
			TabBar,
			myEmployees,
			orderManagement
		},
		data() {
			return {

				currentIndex: 0,
				//  1 模版1 2 模版2 3 模版3 4 模版4
				tabListNum:1,
				showMiddleButtonBar: false,
				
				

			}
		},
		onLoad(options) {
			if (Object.keys(options).length) {
				console.log(options)
				this.currentIndex = Number(options.currentIndex)
			}
		},
		methods: {
			// 如果
			changeItem(item) {
				console.log(item)
				if(item=='selsectCode'){
					console.log('弹出二维码')
				}else{
					this.currentIndex = item
				}
				

			},
			close() {
				debugger
				this.active = false
			},
			open() {}
		},
		
		 watch: {
		    tabListNum: {
		      immediate: true,
		      handler(newValue, oldValue) {
		        // 在值发生变化时执行操作
		        console.log('数值发生变化：', newValue );
				if (newValue == 3 || newValue == 4) {
					this.showMiddleButtonBar = false
				}
		      },
		    },
		  },
	}
</script>

<style lang="scss" scoped>
	.main_box {
		height: calc(100vh - 210rpx);
		overflow: scroll;
	}

	.foot_box {
		height: 110rpx;
	}



	/deep/ .u-popup__content {
		border-radius: 30rpx 30rpx 0 0;
	}
</style>